Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Style Attributes


GXGetShapeStyleAttributes

You can use the GXGetShapeStyleAttributes function to determine which style attributes are set for the style object of a particular shape.

gxStyleAttribute GXGetShapeStyleAttributes(gxShape source);
source
A reference to the shape whose style attributes you want to determine.
function result
The style attributes of the source shape's style object.
DESCRIPTION
The GXGetShapeStyleAttributes function provides a convenient way to determine the style attributes of a shape without having to call the GXGetShapeStyle function to obtain a reference to the shape's style object.

As an example, to examine the gxSourceGridStyle flag of a style object associated with the shape object referenced by the variable source, you could use this code:

if (GXGetShapeStyleAttributes(source) & gxSourceGridStyle) {
   /* shape's style has gxSourceGridStyle attribute set */
}
The gxCenterFrameStyle attribute is set only if both the gxInsideFrameStyle and the gxOutsideFrameStyle attributes are clear, so if you want to test for a centered frame style you need this code:

if (GXGetShapeStyleAttributes(source) & 
   (gxInsideFrameStyle | gxOutsideFrameStyle) == 
   gxCenterFrameStyle) {
   /* shape's style has gxCenterFrameStyle attribute set */
}
ERRORS, WARNINGS, AND NOTICES
Errors
out_of_memory
shape_is_nil
SEE ALSO
For a discussion of style attributes, see "Style Attributes" on page 3-98.

For an example of pen placement, see "Manipulating Pen Width and Placement" beginning on page 3-51.

For an example of constraining shapes to grids, see "Constraining Shape Geometries to Grids" on page 3-40 and "Constraining Shapes to Device Grids" on page 3-42.

To examine or alter the style attributes of a style object, use the GXGetStyleAttributes function, which is described on page 3-109. To alter the style attributes of a style object, use the GXSetStyleAttributes function, which is described on page 3-110.

To alter the style attributes of a style object associated with a particular shape, use the GXSetShapeStyleAttributes function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help